//
//  HSYNavigationBar.m
//  HSYCustomNavigationController
//
//  Created by key on 2017/2/9.
//  Copyright © 2017年 Scho.CustomNavigationController.Demo. All rights reserved.
//

#import "HSYNavigationBar.h"
#import "MacroFaile.h"
#import "HSYNavigationItem.h"
#import "HSYBarButton.h"

#define NAVIGATION_BAR_DEFAULT_HEIGHT            64.0f

@implementation HSYNavigationBar

- (instancetype)initWithLeftItems:(NSArray <HSYNavigationItem *>*)leftItems
{
    return [self initWithLeftItems:leftItems forRightItems:nil];
}

- (instancetype)initWithRightItems:(NSArray <HSYNavigationItem *>*)rightItems
{
    return [self initWithLeftItems:nil forRightItems:rightItems];
}

- (instancetype)initWithLeftItems:(NSArray <HSYNavigationItem *>*)leftItems forRightItems:(NSArray <HSYNavigationItem *>*)rightItems
{
    if (self = [super initWithFrame:CGRectMake(0, 0, IPHONE_WIDTH, NAVIGATION_BAR_DEFAULT_HEIGHT)]) {
        
    }
    return self;
}

#pragma mark - Set Left Items

- (void)setLeftItem:(HSYNavigationItem *)leftItem
{
//    HSYBarButton *barButton = [HSYBarButton showBarButtonByPropertyParams:@{
//                                                                            
//                                                                            }
//                                                           navigationItem:leftItem
//                                                                imageRect:<#(CGRect)#> titleRect:<#(CGRect)#> didClickCompleted:<#^(HSYBarButton *button)completed#>]
}

- (void)setLeftItems:(NSArray <HSYNavigationItem *>*)leftItems
{
    if (leftItems.count == 0) {
        return;
    }
    for (HSYNavigationItem *item in leftItems) {
        [self setLeftItem:item];
    }
}

#pragma mark - Set Right Items

- (void)setRightItem:(HSYNavigationItem *)rightItem
{
    
}

- (void)setRightItems:(NSArray <HSYNavigationItem *>*)rightItems
{
    if (rightItems.count == 0) {
        return;
    }
    for (HSYNavigationItem *item in rightItems) {
        [self setRightItem:item];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
